﻿function initUpload(pathFile){
    $("#album-create").hide();

   $("#btnUpload").click(function () {
       if (validateUpload(pathFile) == true) {
           $("#hddKindSubmit").val("upload");
           document.frmUpload.submit();
       }

   });
   $("#btnCreateAlbum").click(function () {
       $("span[class=check]").remove();
        if($("#album-create").is(":hidden"))
            $("#album-create").show();
        else $("#album-create").hide();
    });
    
}
function validateUpload(pathFile) {
    var isValidate=true;
     $("span[class=check]").remove();
     if (pathFile.val() == "") {
         pathFile.after("<span class='check'>*</span>");
         return false;
     } else if ($(".col #sltAlbum").val().trim() == "Chưa có album nào") {
         $(".col #sltAlbum #btnCreateAlbum").after("<span class='check'>*</span>");
         return false;
     } else 
         if ($("#album-create :visible").val() == "") {
             $("#album-create #txtAlbumName").after("<span class='check'>*</span>");
             return false;
        }
     return isValidate;
}